<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑图书</title>
<link type="text/css" rel="stylesheet" href="../../static/css/style.css" >
<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
	h1 a {
		color:red;
	}
	
	input {
		text-align: center;
	}
</style>
	<script src="../../Script/jquery.js"></script>
	<script src="../../Script/axios.js"></script>
	<script type="text/javascript">
		$(function () {
			$("#sub").click(function () {
				alert($("#book_name").val())
				axios({
					method:"post",
					url:"http://localhost:8080/library/bookAddServlet",
					data:{
						name:$("#book_name").val(),
						author:$("#book_author").val(),
						price:$("#book_price").val(),
						sales:$("#book_sales").val(),
						stock:$("#book_stock").val()
					}
				}).then(function (resp) {
					var flag = resp.data;
					alert(resp.data)
					if(flag==1){
						location.href="http://localhost:8080/library/pages/manager/book_manager.html"
					}
				})
			})
		})
	</script>
</head>
<body>
		<div id="header">
			<img class="logo_img" alt="" src="../../static/img/logo.png" >
			<span class="wel_word">编辑图书</span>
			<div>
				<a href="book_manager.html">图书管理</a>
				<a href="../../index.html">返回商城</a>
			</div>
		</div>
		
		<div id="main">
			<form action="book_manager.html">
				<table>
					<tr>
						<td>名称</td>
						<td>价格</td>
						<td>作者</td>
						<td>销量</td>
						<td>库存</td>
						<td colspan="2">操作</td>
					</tr>		
					<tr>
						<td><input name="book_name" type="text" value="" id="book_name"/></td>
						<td><input name="book_price" type="text" value="" id="book_price"/></td>
						<td><input name="book_author" type="text" value="" id="book_author"/></td>
						<td><input name="book_sales" type="text" value="" id="book_sales"/></td>
						<td><input name="book_stock" type="text" value="" id="book_stock"/></td>
						<td><input type="button" value="提交" id="sub"/></td>
					</tr>	
				</table>
			</form>
			
	
		</div>
		
		<div id="bottom">
			<span>
				图书管理系统.suo &copy;2022
			</span>
		</div>
</body>
</html>